<?php
/*
If you would like to edit this file, copy it to your current theme's directory and edit it there.
Theme My Login will always look in your theme's directory first, before using this default template.
*/
if (isset($_REQUEST['pending']) && $_REQUEST['pending'] == 'activation' ) {
	if ( $template->get_option( 'register_template' ) )
		$templates[] = $template->get_option( 'register_template' );
	$templates[] = 'register-form.php';
	$template->get_template( $templates );
} else if (isset($_REQUEST['checkemail']) && $_REQUEST['checkemail'] == 'confirm' ) {
	if ( $template->get_option( 'lostpassword_template' ) )
		$templates[] = $template->get_option( 'lostpassword_template' );
	$templates[] = 'lostpassword-form.php';
	$template->get_template( $templates );
} else if (isset($_REQUEST['resetpass']) && $_REQUEST['resetpass'] == 'complete' ) {
	if ( $template->get_option( 'resetpass-success' ) )
			$templates[] = $template->get_option( 'resetpass-success' );
		$templates[] = 'resetpass-success.php';
		$template->get_template( $templates );
} else {
?>
<div class="login" id="theme-my-login<?php $template->the_instance(); ?>">
	<?php $template->the_action_template_message( 'login' ); ?>
	<?php $template->the_errors(); ?>
	<?php $register_links = $template->get_action_links(array( 'login' => false, 'lostpassword' => false));?>
	<?php $lostpwd_links = $template->get_action_links(array( 'login' => false, 'register' => false));?>
	<form name="loginform" id="loginform<?php $template->the_instance(); ?>" action="<?php $template->the_action_url( 'login' ); ?>" method="post">
		<div id="user-name<?php $template->the_instance(); ?>">
			<label for="user_login<?php $template->the_instance(); ?>"><?php _e( 'Username:', 'theme-my-login'); ?></label>
			<div id="user-name-input<?php $template->the_instance(); ?>">
				<input type="text" name="log" id="user_login<?php $template->the_instance(); ?>" class="input" value="<?php $template->the_posted_value( 'log' ); ?>" size="20" />
				<span class="help-inline">
					<a target="_blank" href="<?php echo $register_links[0]['url'];?>"><?php echo $register_links[0]['title'];?></a></span>
				</span>
			</div>
			
		</div>
		<div id="user-pwd<?php $template->the_instance(); ?>">
			<label for="user_pass<?php $template->the_instance(); ?>"><?php _e( 'Password:' , 'theme-my-login'); ?></label>
			<div id="user-pwd-input<?php $template->the_instance(); ?>">
				<input type="password" name="pwd" id="user_pass<?php $template->the_instance(); ?>" class="input" value="" size="20" />
				<span class="help-inline">
					<a target="_blank" href="<?php echo $lostpwd_links[0]['url']?>"><?php echo $lostpwd_links[0]['title']?></a></span>
				</span>
			</div>
		</div>

		<?php do_action( 'login_form' ); ?>

		<p class="forgetmenot">
			<input name="rememberme" type="checkbox" id="rememberme<?php $template->the_instance(); ?>" value="forever" />
			<label for="rememberme<?php $template->the_instance(); ?>"><?php esc_attr_e( 'Remember Me' , 'theme-my-login'); ?></label>
		</p>
		<p class="submit">
			<button type="submit" name="wp-submit" id="wp-submit-login<?php $template->the_instance(); ?>"><?php esc_attr_e( 'Log In' , 'theme-my-login'); ?></button>
			<a class="login-btn" target="_blank" href="<?php echo $register_links[0]['url']?>"><?php _e('Register');?></a>
			<input type="hidden" name="redirect_to" value="<?php $template->the_redirect_url( 'login' ); ?>" />
			<input type="hidden" name="instance" value="<?php $template->the_instance(); ?>" />
			<input type="hidden" name="action" value="login" />
		</p>
	</form>
	<?php /*$template->the_action_links( array( 'login' => false) );*/ ?>
</div>
<?php }?>